package com.zm.scsimple.circuit.breaker.client;

import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @author zoum
 * @create 2019/2/22 15:19
 */
@SpringBootApplication
@EnableCircuitBreaker
public class HystrixClientApp {

    public static void main(String[] args) {
        new SpringApplicationBuilder(HystrixClientApp.class).web(WebApplicationType.SERVLET).run(args);
    }

    @LoadBalanced
    @Bean
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
